Field of the Invention
The present invention relates to a communication apparatus, a method for controlling the communication apparatus, and a storage medium.
Description of the Related Art
With the widespread use of the Internet and intranets, the number of Internet Protocol (IP) phones is increasing. The IP phone controls generation, modification, and disconnection of a real-time communication session by using a call control protocol such as Session Initiation Protocol (SIP). The IP phone performs call processing by encoding and compressing the audio (voice and sound) signal in various forms based on the Voice over Internet Protocol (VoIP) technique, performing IP packetizing, and transmitting IP packets to an IP network in real time.
Recently, the G3 facsimile apparatus has also connected with an IP network via a terminal adopter (TA) having a VoIP function and a gateway (GW). Accordingly, VoIP-based facsimile communication via the IP network is increasing. Further, there has been proposed a facsimile apparatus having the VoIP function and employing the deemed voice communication method in which the facsimile apparatus itself directly connects with an IP network and performs audio encoding/decoding and IP packetizing.
On the IP network, since the communication speed is not necessarily kept constant, audio data packets divided and separately transmitted do not necessarily reach the receiving facsimile apparatus side at the same timing as the transmission timing, causing irregular transmission intervals. The IP phone and the facsimile apparatus using the deemed voice communication method absorb and correct such fluctuations of irregular packets to reproduce voice similar to that on the transmitting side. Therefore, the facsimile apparatus is provided with a jitter buffer to prevent interruption of packet output (see FIG. 5). The jitter buffer outputs pre-read audio data packets to an audio codec after accumulating audio data packets to a certain extent.
As the size of the jitter buffer is larger, the number of packets to be accumulated becomes larger and fluctuations of packets can be further reduced. However, the output will be delayed for the time period corresponding to the time period of accumulating packets. Accordingly, from the viewpoint of voice communication and communication quality, it is not desirable to pre-read too many audio data packets by using an excessively large jitter buffer.
The jitter buffer is a First-In First-Out (FIFO) buffer which outputs old audio data packets in the jitter buffer at a timing synchronized with a sampling period of the audio codec while receiving new audio data packets. Audio data packets in the jitter buffer are output in synchronization with the sampling period of the audio encoding method predetermined between the transmitting and the receiving sides, and are reproduced by the audio codec. The reproduced audio signal is input to a telephone or a modem of the facsimile control unit, and voice communication and facsimile communication are performed. Similarly, the transmitting side also transmits audio data packets in synchronization with the sampling period of the audio encoding method predetermined between the transmitting and the receiving sides.
The oscillating frequency of a crystal oscillator is input to the audio codec to generate the sampling period. A difference in the oscillating frequency thereof between the transmitting and the receiving sides causes a difference between the amount of encoded audio data on the transmitting side and the amount of decoded audio data on the receiving side.
Performing facsimile communication for a long period of time in such a state may cause an overflow or underflow of the amount of data in the jitter buffer, possibly resulting in the communication error in facsimile communication.
When the general clock accuracy is ±100 parts per million (ppm) and the packet size is equivalent to 20 milliseconds, the time period T until a difference for one packet occurs is calculated as follows. When the clock accuracies on the transmitting and the receiving sides shift to opposite sides to the maximum extent, the time period T is calculated as T=(20/1000)/((100+100)/1000000)=100 seconds. In this case, if the size of the jitter buffer is equivalent to 20 packets (=400 milliseconds), and if output is started after data for 10 packets (=200 milliseconds) has been captured, a delay of 200 milliseconds occurs when communication is started. Further, a difference for 10 packets toward the positive or the negative side causes an overflow or underflow. Therefore, at most, an error occurs at intervals of 100×10=1000 seconds.
Therefore, performing facsimile communication for a long period of time by using a jitter buffer of the regular size will cause a communication error. Since increasing the size of the jitter buffer increases the delay, the size of the jitter buffer can be increased only to a certain extent in the case of facsimile communication in which the response timing is predefined.
Therefore, a jitter buffer for a facsimile apparatus using the deemed voice communication method needs to have the regular size buffer causing a small amount of delay. Further, it is necessary to perform control for preventing an overflow or underflow in the jitter buffer as required.
Modem modulation methods for the G3 facsimile procedure include the V.17 communication procedure or earlier (see FIG. 6) which is a half-duplex communication sequence in which a signal is not sent from a communication partner facsimile apparatus while the own facsimile apparatus is transmitting a signal. Modem modulation methods further include the V.34 facsimile procedure, which is a full-duplex communication sequence (see FIG. 7) except for image data communication.
With the V.17 facsimile procedure or earlier, the own facsimile apparatus does not receive an effective audio signal from a communication partner facsimile apparatus during facsimile procedure signal transmission, and basically audio data packets contain silence. Therefore, operating audio data packets in the jitter buffer during the facsimile procedure signal transmission does not affect facsimile communication. The jitter buffer can be operated during facsimile procedure signal transmission immediately before image data reception.
Japanese Patent Application Laid-Open No. 2010-166188 discusses a technique for correcting a jitter buffer to the initial state by a terminal adopter, connecting a G3 facsimile apparatus with an IP network, synchronizing with the facsimile procedure signal transmission.
In this control example of prior art, when the amount of data in the jitter buffer shifts toward the depletion side after synchronization with the timing of signal transmission from the connected G3 facsimile apparatus, silent data is inserted so that the final data position in the jitter buffer returns to a predetermined value. On the other hand, when the amount of data in the jitter buffer shifts toward the saturation side, data is discarded so that the final data position becomes a predetermined value.
However, the above-described conventional technique is not effective with the V.34 facsimile procedure for the following reasons.
The V.34 facsimile procedure performs communication by using a primary channel for performing high-speed transmission of image data as illustrated in FIG. 7 and a control channel for performing low-speed procedure signal exchange.
In the primary channel for performing image data reception through half-duplex communication, the receiving facsimile apparatus side receives significant image data and hence the jitter buffer adjustment cannot be performed during image data reception because the jitter buffer adjustment will cause an image error. In the control channel for performing the facsimile procedure through full-duplex communication, the receiving side receives a significant signal from a communication partner facsimile apparatus side at the same time when the receiving side transmits a signal and hence the jitter buffer adjustment cannot be performed during image data reception.
Since the control channel performs phase modulation, inserting or deleting a packet to adjust the amount of data in the jitter buffer may cause a phase shift to cause synchronization loss between modems, making it impossible for the receiving side to perform decoding.
In the V.34 facsimile procedure, therefore, while the own facsimile apparatus is transmitting a signal, the facsimile apparatus constantly receives a significant signal, so that it is difficult to perform the jitter buffer adjustment involving the cancellation and supplement of data in the jitter buffer.
In the V.34 facsimile procedure, if synchronization loss between modems on the transmitting and the receiving sides is likely to occur under inferior communication conditions, a certain procedure aims for achieving resynchronization between modems through control channel retraining (see FIG. 8).
Referring to FIG. 8, the receiving side transmits a signal AC to start the control channel retraining. The signal AC is sent out so as to provide signals with a 180-degree phase rotation on an alternate basis. This signal needs to be responded whenever it is transmitted during control channel communication, and therefore is constantly monitored both on the transmitting and the receiving sides.
Accordingly, even under inferior line conditions, the signal AC is easier to be detected than other signals to start the control channel retraining. When the control channel retraining is started by the signal AC, the receiving and the transmitting sides perform the resynchronization procedure (exchange of shaded signals PPh, ALT, MPh, MPh, and E illustrated in FIG. 2) to recover synchronization between modems again.
The control channel retraining is an effective method for avoiding a communication error caused by modem synchronization loss and divergence due to packet loss, etc. However, it is not possible to avoid a communication failure due to an underflow or overflow in the jitter buffer which causes packet loss.